
#pragma pack_matrix(row_major)
struct GS_INPUT
{
	float4 projectedCoordinate : POSITION;
	float4 colorOut : COLOR;
	float3 transformedNormal : NORMAL;
	float4 surfacePos : SURFACE;
	float3 uvCoods : UV;
};

struct GSOutput
{
	float4 projectedCoordinate : SV_POSITION;
	float4 colorOut : COLOR;
	float3 transformedNormal : NORMAL;
	float4 surfacePos : SURFACE;
	float3 uvCoods : UV;
};

cbuffer Matricies
{
	float4x4 mWorld;
	float4x4 mView;
	float4x4 mProj;
};



[maxvertexcount(4)]
void main(point float4 input[1] : SV_POSITION, inout TriangleStream< GSOutput > output)
{
	
	GSOutput verts[4];

	verts[0].projectedCoordinate = float4(-100.0f, 0.0f, 100.0f, 1.0f);
	verts[0].colorOut = float4(1.0f, 1.0f, 1.0f, 1.0f);
	verts[0].uvCoods = float3(0.0f, 0.0f, 0.0f);
	verts[0].transformedNormal = float3(0.0f, 1.0f, 0.0f);

	
	verts[1].projectedCoordinate = float4(100.0f, 0.0f, 100.0f, 1.0f);
	verts[1].colorOut = float4(1.0f, 1.0f, 1.0f, 1.0f);
	verts[1].uvCoods = float3(1.0f, 0.0f, 0.0f);
	verts[1].transformedNormal = float3(0.0f, 1.0f, 0.0f);

	
	verts[2].projectedCoordinate = float4(-100.0f, 0.0f, -100.0f, 1.0f);
	verts[2].colorOut = float4(1.0f, 1.0f, 1.0f, 1.0f);
	verts[2].uvCoods = float3(0.0f, 1.0f, 0.0f);
	verts[2].transformedNormal = float3(0.0f, 1.0f, 0.0f);

	
	verts[3].projectedCoordinate = float4(100.0f, 0.0f, -100.0f, 1.0f);
	verts[3].colorOut = float4(1.0f, 1.0f, 1.0f, 1.0f);
	verts[3].uvCoods = float3(1.0f, 1.0f, 0.0f);
	verts[3].transformedNormal = float3(0.0f, 1.0f, 0.0f);

	float4x4 mVP = mul(mView, mProj);
	mVP = mul(mWorld, mVP);

	for (uint i = 0; i < 4; i++)
	{
		verts[i].surfacePos = mul(verts[i].projectedCoordinate, mWorld);
		verts[i].projectedCoordinate = mul(verts[i].projectedCoordinate, mVP);
		verts[i].transformedNormal = mul(verts[i].transformedNormal, (float3x3)mWorld);
	}
	output.Append(verts[0]);
	output.Append(verts[1]);
	output.Append(verts[2]);
	output.Append(verts[3]);

	
}